import java.awt.Point;
import java.util.ArrayList;

public class Board {
	private ArrayList<Point> BlackBlocks;
	private ArrayList<Point> WhiteBlocks;
	
	public Board(){
		BlackBlocks = new ArrayList<Point>();
		WhiteBlocks = new ArrayList<Point>();
	}
	public void initiation(){
		BlackBlocks.add(new Point(4,5));
		BlackBlocks.add(new Point(5,4));
		WhiteBlocks.add(new Point(4,4));
		WhiteBlocks.add(new Point(5,5));
	}
	
	public void setBlack(Point p){
		BlackBlocks.add(p);	// For playing a disk
	}
	public void setBlack(ArrayList<Point> p){
		BlackBlocks.addAll(p);	// For reverse use
		WhiteBlocks.removeAll(p);
	}
	
	public void setWhite(Point p){
		WhiteBlocks.add(p); // For playing a disk
	}
	public void setWhite(ArrayList<Point> p){
		WhiteBlocks.addAll(p); // For reverse use
		BlackBlocks.removeAll(p);
	}
	public ArrayList<Point> getBlack(){
		return BlackBlocks;
	}
	public ArrayList<Point> getWhite(){
		return WhiteBlocks;
	}
	public int checkBlock(Point p){
		// return 0 for that block is in used by Black
		//		  1							  by White
		// return -1						  FreeBlock
		if(BlackBlocks.contains(p))
			return 0;
		else if(WhiteBlocks.contains(p))
			return 1;
		return -1;
	}
	public boolean isBoardFull(){
		return BlackBlocks.size() + WhiteBlocks.size() == 64;
	}
	public Integer getWinner(){
		if(BlackBlocks.size()>WhiteBlocks.size())
			return 0;
		else if(BlackBlocks.size()<WhiteBlocks.size())
			return 1;
		else
			return -1;
	}

}
